package com.lib.common.utils;

import android.text.Editable;
import android.widget.EditText;

public class StringHelper {
    static public boolean isEmpty(String s){
        if(s == null || s.length() == 0) return true;
        return false;
    }

    static public String getValidString(String string){
        if(string == null) return "";
        if(string.length() <= 0) return  "";
        return string;
    }
    static public String getValidString(int i){
        return String.valueOf(i);
    }
    static public String editString(EditText pEditText){
        Editable lEditable = pEditText.getText();
        if(lEditable == null) return "";
        String str = lEditable.toString();
        if(isEmpty(str)) return "";
        return str;
    }
}
